package com.design.demo.decorator;

import java.math.BigDecimal;

/**
 * @author guoliang.li
 * @date 2019/12/26 11:54
 * @description TODO 具体装饰者
 */
public class MochaWrapper extends BaseComponent {

    private BaseDecorator decorator;

    public MochaWrapper(BaseDecorator decorator) {
        this.decorator = decorator;
    }

    @Override
    public String getDescription() {
        return decorator.getDescription() + ",Mocha";
    }

    @Override
    public BigDecimal cost() {
        return decorator.cost().add(new BigDecimal("0.20"));
    }
}